package com.towker.frame.service.warehouse;

import java.util.List;
import java.util.Map;

import org.springframework.stereotype.Service;

import com.towker.core.db.BaseService;
import com.towker.core.db.EntityDao;
import com.towker.frame.dao.warehouse.GoodsInOutDao;
import com.towker.frame.model.warehouse.GoodsInOut;

@Service
public class GoodsInOutService extends BaseService<GoodsInOut, java.lang.Long>{

	private GoodsInOutDao dao;

	public void setGoodsInOutDao(GoodsInOutDao dao) {
		this.dao = dao;
	}

	@Override
	protected EntityDao getEntityDao() {
		return dao;
	}

	public int getPreCount(Map map, int page, int pageSize) {
		if (page <=1) {
			return 0;
		} else {
			int maxId = (page -1) * pageSize;
			return dao.getPreCount(map, maxId);
		}
	}

}
